# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
# Maintainer: Jason Chu <jason@archlinux.org>

pkgname=procstatd
pkgver=1.4.2
pkgrel=12
pkgdesc="A daemon that can be run either from userspace or inetd that can be queried via a simple API to parse various files in /proc"
arch=('loong64' 'x86_64')
license=('GPL')
url="http://www.phy.duke.edu/brahma/"
source=(https://downloads.sourceforge.net/herdtools/$pkgname.tar.gz
        procstatd-Makefile.patch
        procstatd-common-symbols.patch)
sha512sums=('02f10a87f9325f0252786a598433596ad1dc2c6412ff8b6fe1f8e19a6e1425497bc0fcf0be085ed7be9434642c7a1f22d4f8018787ab2f6dffe0d1aa566dfcc5'
            '96b8cf197c4589cd602af4cb2860c6f33668789c54991e31060b69fe42aa66c11d86472d7bf2066281b324178752b9f88fc3c8a2787c459a6364b052d597e6a4'
            'b16266faa53d2e3d012dda8d94c42a49100759299b760cd75d7577f127ea576b6c85ea0f8b72a0cda49e6c2250a37f80ad7d775ab7716877d351f6a947a47da6')

prepare() {
  cd "$srcdir"/$pkgname
  patch -p1 -i ../procstatd-Makefile.patch
  patch -p1 -i ../procstatd-common-symbols.patch
}

build() {
  cd "$srcdir"/$pkgname
  make
}

package() {
  cd "$srcdir"/$pkgname
  make DESTDIR="$pkgdir/usr" install
}
